/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ircclient;
import java.util.Scanner;
import java.io.InputStreamReader;
import java.net.Socket;
/**
 *
 * @author Justin
 */
public class GetInput extends Thread {
    private Gui update;
    private Scanner in;
    private Socket s;
    public GetInput(Socket s,Gui g)
    {
        update =g;
        this.s=s;
    }
    @Override
    public void run()
    {
        try
        {
            in= new Scanner(new InputStreamReader(s.getInputStream()));
            catcher();
        }
        catch(Exception e){}
    }
    public void catcher()
    {
        while(true)
        {
            if(in.hasNextLine())
            {
                update.addToChat(in.nextLine());
            }
        }
    }
}
